<template>
  <MSelect v-bind="{ ...config, ...$attrs }"></MSelect>
</template>

<script lang="ts" setup>
  import { ref } from 'vue';
  import { apiGetDriverPage } from '@/api/driver';
  import MSelect from '../MSelect/index.vue';

  const config = ref({
    placeholder: '请选择',
    api: () => {
      return apiGetDriverPage({
        page_num: 1,
        page_size: 999,
      }).then((res) => {
        return { data: res.data.rows };
      });
    },
    valueField: 'driver_id',
    labelField: 'driver_name',
  });
</script>
